<?php 

$admin_pre_folder = "../../";

include $admin_pre_folder.'class.php';

foreach ($_POST as $name => $value) {
	if ($name<>"action" && $name<>"module" && $name<>"id" && $name<>"multitable")
	{
		$value = $sql->escape($value);
		$update[$name] = "'".$value."'";
	}
}

if ($_POST['ertekeles_default']=="1")
{
	$sql->mysql_update("ertekelesek",array("ertekeles_default"=>"0"));
}

if ($_POST['action']=="add")
{
	$theme_id = $sql->mysql_insert("ertekelesek",$update);
}
else
{
	$theme_id = (int)$_POST['id'];
	$sql->mysql_update("ertekelesek",$update,"ertekelesek_id = ".$theme_id);
}

header("Location: ".$admin_pre_folder."index.php?ertekelesek.edit.".$theme_id);

?>